persist the blur event so clients can use it#24
persist the blur event so clients can use it#24triptate wants to merge 2 commits intoreact-component:masterfrom
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/react-component/mentions/lr8wg2lbx |
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
=======================================
Coverage 99.13% 99.13%
=======================================
Files 6 6
Lines 230 232 +2
Branches 52 53 +1
=======================================
+ Hits 228 230 +2
Misses 2 2
Continue to review full report at Codecov.
|
|
@afc163 this one didn't seem to need a test case; however, an alternative strategy would be to add a prop that allows the client to indicate if they would like the event to be persisted in this case (e.g. |
This fixes a bug where the event that is passed to the
onBlurprop will be nullified because the code is executed asynchronously using a timeout. I expect there's a good reason why the timeout is necessary; however, if it were not necessary, then removing the timeout would be a simpler and more efficient solution to this problem sinceevent.persist()creates a copy of the event.